class Loading {
  constructor(config) {
    this.frame = config.frame
    this.frameIndex = 0;
    this.width = config.width;
    this.height = config.height;
    this.x = config.x;
    this.y = config.y;
    this.speed = config.speed;
    this.lastTime = new Date().getTime();
  }
  judge() {
    // const currentTime = new Date().getTime()
    // if (currentTime - this.lastTime > this.speed) {
    //   this.frameIndex++;
    //   if (this.frameIndex > 0) {
    //     state = RUNNING
    //   }
    //   this.lastTime = currentTime
    // }
    setTimeout(() => {
      state = RUNNING
    }, 500)
  }
  paint(context) {
    context.drawImage(this.frame, this.x, this.y)
  }
}